<script type="text/javascript">
function check(){
	var name=$("#name").val();
	if(name==''){
		alert("用户名不能为空");
		$("#name").focus();
		return false;

	}
	
	var patt=new RegExp();
	patt=/\W/;
	if(patt.test(name)){
		alert("用户名只能包含数字字母和下划线！");
		$("#name").focus();
		return false;
	}
	
	var pwd=$("#pwd").val();
	if(pwd==''){
		alert("密码不能为空");
		$("#pwd").focus();
		return false;
	}
}
</script>
<{include file="header.tpl"}>
<{if $error != ''}>
	<{foreach from=$error item=er}>
	错误：<{$er}>
	<{/foreach}>
<{/if}>
<form action="web.php?do=log_in"  method="post" onsubmit="return check()">
用户名：<input type="text" id="name" name="name"/><br/>
密码：<input type="password" id="pwd" name="password"/><br/>
<input type="submit" value="登陆"> 
</form>
<{include file="footer.tpl"}>